<div class="col-md-12">
    <form action="" method="post">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">修改用户 - {$u_info['username']}</h3>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label>用户名</label>
                    <input type="text" name="username" value="{$u_info['username']}" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>昵称</label>
                    <input type="text" name="nickname" value="{$u_info['nickname']}" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>密码</label>
                    <input type="password" name="password" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>后台属组</label>
                    <div class="col-lg-12">
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text">
                                    <input type="checkbox" name="admin_group_leader" value="1"<?php if($u_info['admin_group_leader'] == 1){ echo 'checked'; } ?>>&nbsp;&nbsp;&nbsp;&nbsp;<span id='admin_group_leader'><?php if($u_info['admin_group_leader'] == 1){ echo '全部'; } else { echo '自己'; } ?></span>
                                </span>
                            </div>
                            <select name='admin_group' class="form-control my-colorpicker1">
                                <option value="0" <?php if(0 == $u_info['admin_group']){echo 'selected="selected"';} ?>>无权限</option>
                                <option value="1" <?php if(1 == $u_info['admin_group']){echo 'selected="selected"';} ?>>超级管理员</option>
                            <?php foreach ($group_list[2] as $v){ ?>
                                <option value="{$v.id}" <?php if($v['id'] == $u_info['admin_group']){echo 'selected="selected"';} ?>>{$v.name}</option>
                            <?php } ?>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label>邮箱</label>
                    <input type="text" name="email" value="{$u_info['email']}" class="form-control my-colorpicker1">
                </div>
                <div class="form-group">
                    <label>手机</label>
                    <input type="text" name="phone" value="{$u_info['phone']}" class="form-control my-colorpicker1">
                </div>
            </div>
            <div class="card-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div>
    </form>
</div>
<script>
$(function(){
    $('input[name=admin_group_leader]').click(function(){
        if($(this).is(':checked')){
            $('#admin_group_leader').html('全部');
        } else {
            $('#admin_group_leader').html('自己');
        }
    });
});
</script>